<%@ include file="/jsp/common/tagLibs.jsp"%>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/admin/bankDetails.js"></script>
<c:url var="url" value="/bankdetails/add.html" />
<form:form action="${url}" commandName="bankManagementVO">
	<table width="100%" border="0" align="center">
		<tr width="100%">
			<td width="50%">
			<table width="50%" border="0" align="left">
				<tr>
					<td width="50%">
					<div align="left">
					<h4>Select Bank:</h4>
					<form:select path="selectedBankCode" items="${bankList}"></form:select>
					<input name="saveBank" type="button" id="add" value="Add New">
					</div>
					</td>
				</tr>
				<tr>
					<td width="50%">
					<div align="left">
					<h4>Bank Information</h4>
					</div>
					</td>

				</tr>
				<tr>
					<td width="30%">
					<div align="left">Bank Name</div>
					</td>
					<td width="20%"><form:input path="bankDetails.bankname" /></td>
				</tr>
				<tr>
					<td width="30%">
					<div align="left">Bank Code</div>
					</td>
					<td width="20%"><form:input path="bankDetails.bankcode" /></td>
				</tr>
				<tr>
					<td width="30%">
					<div align="left">Contact Person</div>
					</td>
					<td width="20%"><form:input path="bankDetails.contactperson" />
					</td>
				</tr>
				<tr>
					<td width="30%">
					<div align="left">Address</div>
					</td>
					<td width="20%"><form:input path="bankDetails.street" /></td>
				</tr>

				<tr>
					<td width="30%">
					<div align="left">&nbsp;</div>
					</td>
					<td width="20%"><input id="contAddress2" type="text"
						name="textfield5"></td>
				</tr>
				<tr>
					<td width="30%">
					<div align="left">&nbsp;</div>
					</td>
					<td width="20%"><input id="contAddress2" type="text"
						name="textfield5"></td>
				</tr>
				<tr>
					<td width="30%">
					<div align="left">Phone</div>
					</td>
					<td width="20%"><form:input path="bankDetails.phone" /></td>
				</tr>

				<tr>
					<td width="30%">
					<div align="left">Number</div>
					</td>
					<td width="20%"><form:input path="bankDetails.number" /></td>
				</tr>

				<tr>
					<td width="30%">
					<div align="left">Additional</div>
					</td>
					<td width="20%"><form:input
						path="bankDetails.additionalnumber" /></td>
				</tr>

				<tr>
					<td width="30%">
					<div align="left">Email</div>
					</td>
					<td width="20%"><form:input path="bankDetails.email" /></td>
				</tr>
				<tr>
					<td width="30%">
					<div align="left">ZIP code</div>
					</td>
					<td width="20%"><form:input path="bankDetails.zipcode" /></td>
				</tr>
				<tr>
					<td width="30%">
					<div align="left">City</div>
					</td>
					<td width="20%"><form:input path="bankDetails.city" /></td>
				</tr>
				<tr>
					<td width="30%">
					<div align="left">Country</div>
					</td>
					<td width="20%"><form:input path="bankDetails.country" /> <form:hidden
						path="bankDetails.activeInd" /></td>
				</tr>


			</table>
			</td>
			<td>
			<table width="60%" border="0" align="left">
				<tr>
					<td>
					<div align="left">
					<h4>Factors and Weightage</h4>
					</div>
					</td>

				</tr>
				<c:forEach items="${bankManagementVO.bankfactors}" var="bankfactor" varStatus="status">

					<tr width="30">
						<td width="30%">
						<input type="checkbox" name="factorids" id="factorid[${status.index}]"  class="jMulticheck" id="bankfactors[${status.index}]"
							value="bankfactors${status.index}"   
							<c:if test="${not empty bankfactor.bankcode}">checked="true"</c:if>
							/>${bankfactor.factorid}
						<input type="hidden" name="bankfactors[${status.index}].factorid" id="bankfactors${status.index}_factorid" 
							value="${bankfactor.factorid}" />	
						<input type="hidden" name="bankfactors[${status.index}].bankcode" id="bankfactors${status.index}_bankcode" 
							value="${bankfactor.bankcode}" />	
						</td>
						<td width="10%"><input id="bankfactors_${status.index}_weightage" type="text"
							width="1%" name="bankfactors[${status.index}].weightage" value="${bankfactor.weightage}" ></td>
						<td width="10%"><input id="bankfactors_${status.index}_expectedvalue" type="text"
							width="1%" name="bankfactors[${status.index}].expectedvalue" value="${bankfactor.expectedvalue}"></td>
						<td width="10%"><input id="bankfactors_${status.index}_from" type="text"
							width="1%" name="bankfactors[${status.index}].from" value="<fmt:formatDate pattern="dd-MM-yyyy" value="${bankfactor.from}" />"></td>
						<td width="10%"><input id="bankfactors_{status.index}_to" type="text"
							width="1%" name="bankfactors[${status.index}].to" value="<fmt:formatDate pattern="dd-MM-yyyy" value="${bankfactor.to}"/>"></input></td>
					</tr>
				</c:forEach>
			</table>
			</td>
		</tr>
		<tr width="50%" align="right">
			<td width="50%"><a href="bankSelectScreen.htm"> <input
				name="saveBank" type="submit" id="save" value="Save"> <input
				name="saveBank" type="submit" id="deActivate" value="DeActivate">
			</a></td>
		</tr>
	</table>
</form:form>